import axios from 'axios'

const { VITE_GLOB_BASE_URL, VITE_GLOB_API_URL, DEV, VITE_USE_MOCK, VITE_PORT } =
    import.meta.env;
const isUseMock = VITE_USE_MOCK === "true"; // 是否开启mock
const baseURL =
    DEV && isUseMock
        ? `http://localhost:${VITE_PORT}${VITE_GLOB_API_URL}`
        : VITE_GLOB_BASE_URL;

// 创建axios实例
const service = axios.create({
    baseURL, // URL地址
    timeout: 120 * 1000, // 超时时间
});



export default service